#include <stdio.h>
#include <pthread.h>
//gcc -lpthread

void* handler_thread(void* arg){
    printf("in thread\n");
    printf("%ld\n",pthread_self());
    pthread_exit(NULL);
}


int main(void){
    pthread_t tid=-1;
    if(pthread_create(&tid,NULL,handler_thread,NULL) != 0){
        perror("pthread_create err");
        return -1;
    }
    
    printf("in main before\n");
    pthread_join(tid,NULL);
    printf("in main\n");

    return 0;
}